home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98a.txt
/
000106_icon-group-sender _Mon Mar 9 07:54:09 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA21034
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 9 Mar 1998 07:54:08 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA02611; Mon, 9 Mar 1998 07:54:08 -0700
To: icon-group@optima.CS.Arizona.EDU
Date: 7 Mar 1998 07:45:35 GMT
From: jeffery@cs.utsa.edu (Clinton Jeffery)
Message-Id: <6dqtuv$g94@ringer.cs.utsa.edu>
Organization: The University of Texas at San Antonio
Sender: icon-group-request@optima.CS.Arizona.EDU
References: <3500e0ab.4475385@news.waymark.net>
Reply-To: jeffery@cs.utsa.edu
Subject: Re: Memory Use Questions
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 1562
Gary Hill (ghill@waymark.net) wrote:
: When allocating a new object does Icon perform a garbage collection
: before asking NT for more memory, or does it only perform a garbage
: collection after asking for memory and being refused ?
Icon garbage collects, and only asks the OS for more memory when garbage
collection fails to free up enough memory to satisfy a request.
: I've noticed that the amount of memory used by an application under NT
: increases but never decreases. Is there a way to return unused memory
: back to the system after a garbage collection ?
No, the unused memory is retained for use by subsequent memory allocations.
: If you create a list, then assign records to it:
: every idx := 1 to 10000 do {...build a_record put (listx , a_record)}
: then empty the list, will the garbage collection process reclaim the
: space used by the records if nothing else in the program refers to them?
Yes.
By the way, if you know your list has 10000 elements, it uses less space,
and is faster, to ask for a list of 10000 elements: listx := list(10000) and
assign those records by subscript:
every idx := 1 to 10000 do { ...build a_record; listx[i] := a_record }
When you use put() to build very large lists, the interpreter allocates extra
memory in anticipation of future calls to put(), resulting in some internal
fragmentation that you can avoid if you know the correct size.
--
Clint Jeffery, jeffery@cs.utsa.edu
Division of Computer Science, The University of Texas at San Antonio
Research http://www.cs.utsa.edu/research/plss.html